#include <vector>

using namespace std;

/*
vector<int> table(128, 0);

unordered_map<char, int>

for (char c : str) {
  if (table[c] == 0) {
    table[c] = 1;
  }
  else {
    ++table[c];
  }
}

for (int i = 0; i < str.size(); ++i) {
  if (table[str[i]] == 1) {
    return i;
  }
}

vector<int> result {28, 26};
diff 2

vector<int> v1 {-1, 3, 5, 10, 20, 28};
                                      ^i1

vector<int> v2 {15, 17, 26, 134, 135};
                            ^i2

if (v1[i1] < v2[i2]) {
  if (v2[i2] - v1[i1] < diff) {
    diff = v2[i2] - v1[i1];
    result[0] = v1[i1];
    result[1] = v2[i2];
  }

  ++i1;
}
else if (v1[i1] > v2[i2]) {
  if (v1[i1] - v2[i] < diff) {
    diff = v1[i1] - v2[i2];
    result[0] = v1[i1];
    result[1] = v2[i2];
  }
}
else if (v1[i1] == v2[i2]) {
  return {v1[i1], v2[i2]};
}

*/

vector<int> minDiff(const vector<int> &v1, const vector<int> &v2) {
  int i1 = 0;
  int i2 = 0;
  int diff = INT_MAX;
  vector<int> result(2, 0);

  while (i1 < v1.size() && i2 < v2.size()) {
    int m = v1[i1];
    int n = v2[i2];
    int current = 0; // 当前 i1 和 i2 这两个位置上值的差

    if (m < n) {
      current = n - m;
      ++i1;
    }
    else if (m == n) {
      return {m, n};
    }
    else {
      // m > n
      current = m - n;
      ++i2;
    }

    if (current < diff) {
      diff = current;
      result[0] = m;
      result[1] = n;
    }
  }

  return result;
}

int main(int argc, char const *argv[])
{
  /* code */
  return 0;
}
